<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>文章分类</title>
<%@ include file="/WEB-INF/layouts/comm/form.jsp"%>
</head>
<body>
	<div class="mod_header">
		<div class="title">
			<h2 id="h_title">文章分类</h2>
		</div>
	</div>
	<ol class="breadcrumb">
		<li><a href="#">管理设置</a></li>
		<li><a href="${ctx}/webCustomer/advType/index">文章分类</a></li>
		<li class="active">新建文章分类</li>
	</ol>
	<div class="mod_basic">
		<div class="title">
			<h3>新建文章分类</h3>
		</div>

		<div class="content">
			<div class="sub_content">
				<form class="form-horizontal" action="save" id="advType_form" method="post">
					<input type="hidden" class="form-control" id="id" name="id"
						value="${advType.id}">
					<div class="form-group">
						<label for="examTime" class="col-sm-2 control-label">分类名称：</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="title" name="title"
								value="${advType.title}">
						</div>
					</div>
					<div class="form-group">
						<label for="resTime" class="col-sm-2 control-label">分类描述：</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="contentd"
								name="content" value="${advType.content}">
						</div>
					</div>
					<div class="form-group">
						<label for="title" class="col-sm-2 control-label">分类图片外链地址：</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="imgUrl" name="imgUrl"
								value="${advType.imgUrl}">
						</div>
					</div>
					<div class="form-group">
						<label for="title" class="col-sm-2 control-label">外链网站或活动
							：</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="wUrl" name="wUrl"
								value="${advType.wUrl}">
						</div>
					</div>
					<div class="form-group">
						<label for="title" class="col-sm-2 control-label">排序：</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="orderId"
								name="orderId" value="${advType == null? 1 :advType.orderId}">
						</div>
					</div>
					<div class="form-group">
						<label for="title" class="col-sm-2 control-label">是否显示：</label>
						<div class="col-sm-10">
							<input type="radio" id="showing1" name="showing" value="1"
								${advType == null? 'checked="checked"': advType.showing == 1? 'checked="checked"':''}>是
								
							<input type="radio" id="showing2" name="showing" value="0"
								${advType.showing == 0? 'checked="checked"':''}>否
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="submit" class="btn btn-primary">保存</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<footer_body> <script>
		base.menu.active('menu_206');

		base.form.validation("#advType_form", {
			rules : {
				title : {
					required : true
				},
				content:{
					maxlength:30
				},
				orderId : {
					required : true,
					digits : true
				}
			},
			ignore : ""
		});

		base.form
				.ajaxSubmit({
					formid : '#advType_form',
					cbfun : function(data) {
						if (data.data == true) {
							BootstrapDialog
									.show({
										message : "设置成功",
										size : BootstrapDialog.SIZE_SMALL,
										buttons : [
												{
													label : '添加',
													cssClass : 'btn-success',
													action : function(dialogRef) {
														window.location.href = "${ctx}/webCustomer/advType/add";
													}
												},
												{
													label : '查看文章分类信息',
													cssClass : 'btn-warning',
													action : function(dialogRef) {
														window.location.href = "${ctx}/webCustomer/advType/index";
													}
												} ]
									});
						} else {
							BootstrapDialog.alert("保存失败，请重试");
						}
					}
				});
	</script> </footer_body>
</body>
</html>